<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { ref, onMounted } from 'vue'
import { myListAPI } from '@/api/login'

const itemList = ref([
  { label: '场地地点', key: '-' },
  { label: '预约时间', key: 'createTime' },
  { label: '申请人', key: 'reqUserName' },
  { label: '手机号', key: 'reqUserPhone' },
  { label: '申请时间', key: 'createTime' },
  { label: '审批编号', key: '-' },
])

const listData = ref([])

onLoad((options) => {
  const item = JSON.parse(decodeURIComponent(options.item))
  console.log(item, '23===')
  listData.value.push(item)
})

// onMounted(() => {
//   getList()
// })
</script>

<template>
  <view class="my-approval">
    <view class="list">
      <detail-card
        v-for="(item, index) in listData"
        :key="index"
        :title="item.reqName"
        :status="item.status + ''"
        :obj="item"
        :itemList="itemList"
      ></detail-card>
      <no-data v-if="listData.length == 0" />
    </view>
    <view class="approval">
      <approval-process />
    </view>
  </view>
</template>

<style lang="scss" scoped>
.my-approval {
  min-height: 100vh;
  background: #f5f5f5;
  padding-bottom: 40rpx;

  .fixed-tab {
    position: sticky;
    top: 0;
  }

  .list {
    padding: 30rpx 24rpx 0;
  }

  .approval {
    padding: 0 24rpx;
  }
}

.limit2 {
  overflow: hidden;
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.limit3 {
  overflow: hidden;
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
</style>
